package cn.kbyue.batchdemo.step;

import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.listener.JobExecutionListenerSupport;

/**
 * @author XL
 * @version 0.1
 * @date 2022/1/13 17:51
 */
public class JobCompleteListener extends JobExecutionListenerSupport {

    @Override
    public void afterJob(JobExecution jobExecution) {
        if (jobExecution.getStatus() == BatchStatus.COMPLETED) {
            System.out.println("批处理任务已经完成!");
        }
    }

}
